package swing.renderer;

import java.lang.reflect.Field;

import javax.swing.JSlider;

public class SliderRenderer extends Renderer{

	JSlider slider;
	
	public SliderRenderer(Field field, String name, String desctiption, String iconURL, Object initialValue) {
		super(field, name, desctiption, iconURL, initialValue);

		Integer value  = (Integer)initialValue;
		if (value==null) value = 50;
		slider = new JSlider(JSlider.HORIZONTAL, 0, 100, value);
		slider.setToolTipText(description);
		add(slider);
		add(slider);
		slider.setName(name);
	
	
	}

	@Override
	public Object getValue() {
		return slider.getValue();
	}
	
	

}
